package pers.cyril.study.graphql.demo.entity;

import java.util.List;
import java.util.Objects;

/**
 * 说点什么吧
 *
 * @author Wang Cyril
 * @date 2024/7/2 21:51
 */
public class City {

    private String code;

    private String name;

    private String provinceCode;

    private List<Area> areas;

    public City() {
    }

    public City(String code, String name, String provinceCode) {
        this.code = code;
        this.name = name;
        this.provinceCode = provinceCode;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getProvinceCode() {
        return provinceCode;
    }

    public void setProvinceCode(String provinceCode) {
        this.provinceCode = provinceCode;
    }

    public List<Area> getAreas() {
        return areas;
    }

    public void setAreas(List<Area> areas) {
        this.areas = areas;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        City city = (City) o;
        return Objects.equals(code, city.code) && Objects.equals(name, city.name) && Objects.equals(provinceCode, city.provinceCode) && Objects.equals(areas, city.areas);
    }

    @Override
    public int hashCode() {
        return Objects.hash(code, name, provinceCode, areas);
    }
}
